package fr.efrei.musicpliz.dao;

import fr.efrei.musicpliz.entity.AbstractEntity;

/**
 * Abstract DAO-class to provide simple CRUD operations for every specific DAO
 * @param <E>
 * 		the entity-type to be defined in the specific DAOs
 */
public interface AbstractDao<E extends AbstractEntity> {
	
	/**
	 * Simple get-operation
	 * @param id
	 * 		the id of the entity to be retrieved
	 */
	@Deprecated
	// Try to fix this one -> make it generic..
	E get(int id);

	/**
	 * Simple delete-operation
	 * @param e
	 * 		the entity to be deleted
	 */
	void delete(E e);

	/**
	 * Saves and/or updates the Entity
	 * @param e
	 * 		the entity to be updated
	 */
	E save(E e);
}
